import Vue from 'vue'
import Router from 'vue-router'

import home from '../views/tabbar/home'
import search from '../views/tabbar/search'
import cart from '../views/tabbar/cart'
import member from '../views/tabbar/member'
import newslist from '../views/news/newslist'
import newsinfo from '../views/news/newsinfo'
import photolist from '../views/photos/photolist'
import photoinfo from '../views/photos/photoinfo'
import goodslist from '../views/goods/goodslist'
import goodsinfo from '../views/goods/goodsinfo'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      component: home,
    },
    {
      path: '/search',
      component: search
    },
    {
      path: '/cart',
      component: cart
    },
    {
      path: '/member',
      component: member
    },
    {
      path: '/home/newslist',
      component: newslist
    },
    {
      path: '/home/newsinfo/:id',
      component: newsinfo
    },
    {
      path: '/home/photolist',
      component: photolist
    },
    {
      path: '/home/photoinfo/:id',
      component: photoinfo
    },
    {
      path: '/home/goodslist',
      component: goodslist
    },
    {
      name: 'goodsinfo',
      path: '/home/goodsinfo/:id',
      component: goodsinfo
    }
  ]
})
